﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;
using System.Data;
//using System.Data.Objects;
using System.Linq;
using MongoDB;
namespace PicturePortfolio.Persistance
{
    public interface IRepository
    {
        //IMongoCollection<TEntity> GetQuery<TEntity>() where TEntity : class;
        IList<TEntity> GetAll<TEntity>() where TEntity : class;
        IList<TEntity> Find<TEntity>(Expression<Func<TEntity, bool>> criteria) where TEntity : class;
        TEntity Single<TEntity>(Expression<Func<TEntity, bool>> criteria) where TEntity : class;
        TEntity First<TEntity>(Expression<Func<TEntity, bool>> criteria) where TEntity : class;
        void Add<TEntity>(TEntity entity) where TEntity : class;
        void Delete<TEntity>(TEntity entity) where TEntity : class;
        void Delete<TEntity>(IEnumerable<TEntity> entites) where TEntity : class;

        //void Attach<TEntity>(TEntity entity) where TEntity : class;
        //void Attach<TEntity>(IEnumerable<TEntity> entites) where TEntity : class;

        //void SaveChanges();
        //ObjectContext CurrentContext { get; }
        //bool EnableEagerLoading { get; set; }
        void Update<TEntity>(TEntity entity, TEntity old) where TEntity : class;
    }
}
